{% load static %}
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>投票结果 - {{ question.question_text }}</title>
    <link href="https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <style>
        :root {
            --primary-color: #7e57c2;
            --primary-light: #b085f5;
            --primary-dark: #5e35b1;
            --secondary-color: #9575cd;
            --bg-color: #f9f5ff;
            --card-color: #ffffff;
            --text-color: #2d3748;
            --text-light: #718096;
            --border-color: #e2e8f0;
            --shadow-color: rgba(126, 87, 194, 0.1);
        }
        
        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }
        
        body {
            font-family: 'Noto Sans SC', '微软雅黑', sans-serif;
            background-color: var(--bg-color);
            color: var(--text-color);
            line-height: 1.6;
            padding: 0;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            background-image: radial-gradient(circle at 10% 20%, rgba(233, 213, 255, 0.3) 0%, rgba(255, 255, 255, 0) 90%);
        }
        
        .container {
            max-width: 800px;
            margin: 40px auto;
            background: var(--card-color);
            border-radius: 20px;
            box-shadow: 0 10px 30px var(--shadow-color);
            padding: 40px;
            position: relative;
            overflow: hidden;
            z-index: 1;
        }
        
        .container::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 8px;
            background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
        }
        
        .page-title {
            color: var(--primary-dark);
            text-align: center;
            margin-bottom: 40px;
            font-weight: 700;
            font-size: 1.8rem;
            position: relative;
            padding-bottom: 15px;
        }
        
        .page-title::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 80px;
            height: 4px;
            background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
            border-radius: 2px;
        }
        
        .result-container {
            margin-bottom: 40px;
        }
        
        .poll-list {
            list-style: none;
            padding: 0;
            margin: 0;
        }
        
        .poll-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 18px 20px;
            margin-bottom: 12px;
            background: var(--card-color);
            border-radius: 12px;
            border: 1px solid var(--border-color);
            transition: all 0.3s ease;
            position: relative;
        }
        
        .poll-item::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            height: 100%;
            width: 0;
            background: linear-gradient(90deg, rgba(126, 87, 194, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
            transition: width 0.5s ease;
            z-index: 0;
        }
        
        .poll-item:hover::before {
            width: 100%;
        }
        
        .choice-text {
            flex: 1;
            position: relative;
            z-index: 1;
        }
        
        .vote-count {
            background-color: var(--primary-light);
            color: white;
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 0.9rem;
            font-weight: 500;
            min-width: 80px;
            text-align: center;
            position: relative;
            z-index: 1;
            box-shadow: 0 2px 8px rgba(126, 87, 194, 0.2);
        }
        
        .action-buttons {
            display: flex;
            justify-content: center;
            gap: 15px;
            margin-top: 30px;
        }
        
        .action-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 12px 24px;
            background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
            color: white;
            border-radius: 12px;
            text-decoration: none;
            font-weight: 500;
            transition: all 0.3s ease;
            box-shadow: 0 4px 6px rgba(126, 87, 194, 0.2);
            border: none;
            cursor: pointer;
            font-size: 1rem;
        }
        
        .action-btn.secondary {
            background: linear-gradient(135deg, #a5a5a5, #7a7a7a);
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }
        
        .action-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 12px rgba(126, 87, 194, 0.3);
        }
        
        .action-btn.secondary:hover {
            box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
        }
        
        @media (max-width: 768px) {
            .container {
                margin: 20px;
                padding: 30px 20px;
                border-radius: 16px;
            }
            
            .page-title {
                font-size: 1.5rem;
                margin-bottom: 30px;
            }
            
            .poll-item {
                padding: 15px;
                flex-direction: column;
                align-items: flex-start;
                gap: 8px;
            }
            
            .vote-count {
                align-self: flex-end;
            }
            
            .action-buttons {
                flex-direction: column;
                gap: 12px;
            }
            
            .action-btn {
                width: 100%;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <h1 class="page-title">{{ question.question_text }}</h1>
        
        <div class="result-container">
            <ul class="poll-list">
                {% for choice in question.choice_set.all %}
                <li class="poll-item">
                    <span class="choice-text">{{ choice.choice_text }}</span>
                    <span class="vote-count">{{ choice.votes }} vote{{ choice.votes|pluralize }}</span>
                </li>
                {% endfor %}
            </ul>
        </div>
        
        <div class="action-buttons">
            <a href="{% url 'polls:detail' question.id %}" class="action-btn">再次投票</a>
            <a href="{% url 'polls:index' %}" class="action-btn secondary">投票首页</a>
        </div>
    </div>
</body>
</html>